home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: marino.ladavac@aut.alcatel.at (Marino Ladavac)
- Newsgroups: comp.lang.c,comp.lang.c.moderated
- Subject: Re: Leading and Trailing Blanks
- Followup-To: comp.lang.c,comp.lang.c.moderated
- Date: 5 Jan 1996 09:54:15 -0600
- Organization: Alcatel Austria AG
- Sender: clc@solutions.solon.com
- Approved: clc@solutions.solon.com
- Message-ID: <4cjhj7$fbi@solutions.solon.com>
- References: <4chh1b$685@solutions.solon.com>
- NNTP-Posting-Host: solutions.solon.com
- X-Newsreader: TIN [version 1.2 PL2]
-
-
- Casey Claiborne (mskc@io.com) wrote:
-
- : Hello -
- : I am wondering if anyone out there has a program (or knows of one)
- : that allows one to strip leading and trailing blanks from a string.
- : ex:
-
- : char test[20];
- : strcpy(test," TESTING ");
- : printf("%s", test);
-
- : will produce an output like
- : TESTING
-
- : that has blanks at the beginning of "TESTING". I would like to
- : have the following result
-
- : TESTING
-
- : that has no leading blanks.
-
- : I would *greatly* appreciate any type of help or hints in working with
- : this.
-
- : I'll be looking out here, but e-mails are also appreciated :)
-
- Even though this has nothing at all to do with C language, if you have
- the source (I assume that you do,) check out regex find and replace of
- your editor.
-
- Even if you don't have the source, you might be able to use emacs to
- interactively regex edit the binary.
-
- If your editor does not do regex magic, perl has been ported to a vast
- majority of platforms (cf. comp.lang.perl.)
-
- Hope this helps,
-
- /Alby
-